<?php
//header( "Content-Type: text/xml" );
echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';
session_start();

if( isset($_SESSION['AgentID']))
{

include("mysql_connect.php");

	$strSqlCommand = 'SELECT FirstName, LastName, REOffice_idREOffice, OfficePhone, CellPhone, Email
					  FROM REAgent tbAG
					  LEFT JOIN Contactinformation tbCT ON tbAG.Contactinformation_idContactinformation = tbCT.idContactinformation
					  WHERE AgentID = "'. $_SESSION['AgentID'].'"';

	$result = mysql_query($strSqlCommand);
	$rowDetail = @mysql_fetch_array($result);	

	$_SESSION['OfficeID'] = $rowDetail['REOffice_idREOffice'];


	echo '
		<Data>
			<FirstName>'.$rowDetail['FirstName'].'</FirstName>
			<LastName>'.$rowDetail['LastName'].'</LastName>
			<OfficePhone>'.$rowDetail['OfficePhone'].'</OfficePhone>
			<CellPhone>'.$rowDetail['CellPhone'].'</CellPhone>
			<Email>'.$rowDetail['Email'].'</Email>
		</Data>
	';
}
?>